/**
 * Copyright 2008-2009. Chongqing Communications Industry Services Co.,Ltd Information Technology Branch. All rights
 * reserved. <a>http://www.cqcis.com</a>
 */
package com.cq.bd.service;

import java.util.List;
import java.util.Map;

import com.cq.base.domain.Page;
import com.cq.bd.domain.SFunction;
import com.cq.bd.domain.SFunctionReso;

/**
 * 权限管理服务
 * 
 * @author huangmy
 * @date   2009-10-5
 */
public interface FuncService {
    /**
     * 创建权限
     * 
     * @param func
     */
    public Long doCreateFunc(SFunction func);
    
    /**
     * 获取该权限下的所有子权限
     * 
     * @param upperFuncId
     * @return
     */
    public List<SFunction> doGetSubFuncs(Long upperFuncId);
    
    /**
     *  修改状态
     * 
     * @param funcId
     * @param state
     */
    public void doChangeState(Long funcId, int state);
    
    /**
     * 修改权限
     * 
     * @param func
     */
    public void doUpdateFunc(SFunction func);
    
    /**
     * 获取权限
     * 
     * @return
     */
    public List<SFunction> doGetFuncs();
    
    /**
     * 分页查询
     * 
     * @param filter
     * @param like
     * @param sort
     * @param pageNo
     * @param pageSize
     * @return
     */
    public Page pageFuncs(Map<String, String> filter, Map<String, String> like, Map<String, String> sort, int pageNo, int pageSize);
    
    /**
     * 获取权限
     * 
     * @param funcId
     * @return
     */
    public SFunction doGetFunc(Long funcId);
    
    /**
     * 关联资源
     * 
     * @param funcReso
     */
    public void doCreateFuncReso(SFunctionReso funcReso);
    
    /**
     * 删除关联
     * 
     * @param funcReso
     */
    public void doRemoveFuncReso(SFunctionReso funcReso);
    
    /**
     * 通过权限ID获取资源ID
     * 
     * @param funcId
     * @return
     */
    public List<SFunctionReso> doGetFuncResos(Long funcId);
}
